using UnityEngine;
using System.Collections;

public class MoveBySpeedOnUpdate : CharacterAction
{
	public float speedForward;
	public float speedUp;	
    public float speedRight;
    public bool usingCharacterSpeed = true;

    public override void OnFrameUpdate (Character.FrameUpdate arg)
	{
        Character character = arg.character;
        float speed = character.Property.speed;
        if(!usingCharacterSpeed)
        {
            speed = speedForward;
        }
        character.rigidbodyRef.velocity = character.transformRef.forward * speed + 
			character.transformRef.right * speedRight + 
			character.transformRef.up * speedUp;
	}

    public override void OnActionEnter(Character character)
    {
        base.OnActionEnter(character);
    }

    public override void OnActionExit(Character character)
    {
        base.OnActionExit(character);
    }
}

